package com.patMall.service.impl;

import com.patMall.entity.AnswerProblem;
import com.patMall.mapper.AnswerProblemMapper;
import com.patMall.service.AnswerProblemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 750909637@qq.com
 * @PackageName patMall
 * @Package com.patMall.service.impl
 * @Date 2024/1/19 12:41
 * @Version 1.0
 */
@Service
public class AnswerProblemServiceImpl implements AnswerProblemService {
    @Resource
    private AnswerProblemMapper answerProblemMapper;

    @Override
    public int addAnswerProblem(AnswerProblem answerProblem) {
        return answerProblemMapper.insertAnswerProblem(answerProblem);
    }

    @Override
    public int updateAnswerProblem(AnswerProblem answer) {
        return answerProblemMapper.updateAnswerProblem(answer);
    }

    @Override
    public List<AnswerProblem> selectAnswerProblemByCommodityId(Integer commodityId) {
        return answerProblemMapper.selectAnswerProblemByCommodityId(commodityId);
    }

    @Override
    public List<AnswerProblem> selectAnswerProblemByAnswerProblemId(Integer answerProblemId) {
        return answerProblemMapper.selectAnswerProblemByAnswerProblemId(answerProblemId);
    }

    @Override
    public List<AnswerProblem> selectAllAnswerProblem() {
        return answerProblemMapper.selectAllAnswerProblem();
    }

    @Override
    public List<AnswerProblem> getAllByAnswerProblemContent(String content) {
        return answerProblemMapper.getAllByAnswerProblemContent(content);
    }
}
